package com.boot.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.boot.enums.WeekEnum;
import lombok.Data;

import java.util.List;

@Data
@TableName("t_user") //MyBatis-Plus:实体类上需要指定TableName
public class User {

    //主键ID  IdType.AUTO:自增
    @TableId(value = "id",type = IdType.AUTO)
    private Long id;

    //value:需要指定数据库字段名称 如果数据库字段名称和实体类字段名称一致
    //则不需要额外指定 如果不一致需要额外指定
    @TableField(value = "userName")
    private String userName;

    //value默认可以省略
    @TableField("password")
    private String password;

    @TableField(exist = false)
    private List<Menu> menus;

    @Version
    private int version;

    @TableField("week")
    private WeekEnum week;

    @TableLogic(value = "1",delval = "0")
    @TableField("deleteStatus")
    private Integer deleteStatus;

}
